package ch.usi.inf.pf2.gui.listener;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.ImageIcon;
import javax.swing.JOptionPane;

import ch.usi.inf.pf2.gui.JSpreadSheetGUI;

/**
 * Listener for the menu and button "Help"
 * 
 * @author Lorenzo Baracchi <lorenzo.baracchi@usi.ch>, Ebrisa Savina
 *         Mastrodicasa
 * 
 */

public class HelpActionListener implements ActionListener
{
    private JSpreadSheetGUI spreadTable;

    public HelpActionListener(JSpreadSheetGUI spreadTable)
    {
	   this.spreadTable = spreadTable;
    }

    @Override
    public void actionPerformed(ActionEvent e)
    {
	   String message = "Enjoy \nA spread-sheet designed to have fun with computations.\n\n" +
	   				"Developers:\n" +
	   				"Lorenzo Baracchi, Thomas Mantegazzi, Ebrisa Savina Mastrodicasa, Yotam Sharon \n\n" +
	   				"\tAnalyzer and Parser:\n" +
	   				"Thomas Mantegazzi, Yotam Sharon \n\n" +
	   				"\tData definition and Management:\n" +
	   				"Lorenzo Baracchi, Ebrisa Savina Mastrodicasa \n\n" +
	   				"\tGUI: \n" +
	   				"Lorenzo Baracchi, Thomas Mantegazzi, Ebrisa Savina Mastrodicasa, Yotam Sharon \n\n" +
	   				"\tArtworks: \n" +
	   				"Lorenzo Baracchi";
	   
	   JOptionPane.showMessageDialog(spreadTable.getFrame(), message, "About",
			 JOptionPane.INFORMATION_MESSAGE, new ImageIcon("Icons/spreadsheet.gif"));
    }

}
